//
//  StatusNormalCell.swift
//  Weibo
//
//  Created by 李亚乐 on 15/12/14.
//  Copyright © 2015年 李亚乐. All rights reserved.
//

import UIKit

// MARK: - 自定义 Cell
/// 原创微博 Cell
class StatusNormalCell: StatusCell {
    
    /// 原创微博的视图模型
    override var viewModel: StatusViewModel? {
        didSet {
            picView.snp_updateConstraints { (make) -> Void in
            // 根据配图数量，决定配图视图的顶部间距
            let offset = viewModel?.thumbnailURLs?.count > 0 ? StatusCellMargin : 0
            make.top.equalTo(textView.snp_bottom).offset(offset)
            }
        }
    }

    override func setupUI() {
        super.setupUI()
        // 配图视图
        picView.snp_makeConstraints(closure: { (make) -> Void in
            make.left.equalTo(textView.snp_left)
            make.top.equalTo(textView.snp_bottom).offset(StatusCellMargin)
            make.width.equalTo(300)
            make.height.equalTo(90)
        })
    }
}
